package main

import (
	"code.oldboy.com/studygo/LogTransfer/conf"
	"code.oldboy.com/studygo/LogTransfer/es"
	"code.oldboy.com/studygo/LogTransfer/kafka"
	"fmt"
	"gopkg.in/ini.v1"
)

var cfg =new(conf.LogTransferConfig)
func main() {

		//加载配置文件


	err := ini.MapTo(cfg, "./conf/config.ini")
	if err!=nil {
		fmt.Println(err)
		return
	}
	fmt.Println(cfg)
	//初始化es
	err = es.EsInit(cfg.Es.Addr)
	if err!=nil {
		fmt.Println(err)
	}
	//初始化kafka
	//发送消息es
	err = kafka.Init([]string{cfg.Kafka.Addr}, cfg.Kafka.Topic)
	if err!=nil {
		fmt.Println(err)
		return
	}
	select {

	}
}


